package com.ky.pro.java.fx.spring.entity;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import lombok.Data;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Kevin
 */
@Data
public class School implements ISchool {

    Long id;

    String name;

    Set<Klass> klasses;

    static Gson gson = new GsonBuilder().create();

    public School() {
        klasses = new HashSet<>();
    }

    public void addKlass(Klass klass) {
        klasses.add(klass);
    }

    @Override
    public void dump() {

        System.out.println(gson.toJson(this));

    }

}
